package org.firebug.spring.boot.swagger.web.bean.voi;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.firebug.spring.boot.swagger.web.bean.core.Gender;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel
public class UserSaveVOI {
    @NotBlank(message = "name required")
    @ApiModelProperty(name = "name", value = "姓名", required = true, dataType = "string")
    private String name;

    @NotNull(message = "salary required")
    @ApiModelProperty(name = "salary", value = "薪资", required = true, dataType = "number")
    private BigDecimal salary;

    @NotNull(message = "gender required")
    @ApiModelProperty(name = "gender", value = "性别", required = true, dataType = "string")
    private Gender gender;

    @NotNull(message = "birthday required")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(name = "birthday", value = "生日", required = true, dataType = "string", example = "2018-01-01 00:00:00")
    private Date birthday;
}
